package per.hx.bs.web.yw.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.*;
import per.hx.bs.entity.yw.YwLeaveDO;

import java.util.List;
import java.util.Map;

/**
 * @author HuXing
 * @date 2018/4/20  9:22
 */
@Primary
@FeignClient(value = "Huxingbs-Sys-Service")
public interface YwLeaveService {
    /**
     * 按条件获取请假申请
     *
     * @param map 条件
     * @return 报销申请
     */
    @PostMapping(value = "yw-service/leave/leaveList")
    List<YwLeaveDO> leaveList(@RequestBody Map<String, Object> map);

    /**
     * 按条件获取请假申请
     *
     * @param map 条件
     * @return 报销申请
     */
    @PostMapping(value = "yw-service/leave/leaveListByMap")
    List<YwLeaveDO> leaveListByMap(@RequestBody Map<String, Object> map);

    /**
     * 按条件获取报销申请数量
     *
     * @param map 条件
     * @return 报销申请数量
     */
    @PostMapping(value = "yw-service/leave/leaveCount")
    int leaveCount(@RequestBody Map<String, Object> map);

    /**
     * 获取请假数据
     *
     * @param id id
     * @return 请假数据
     */
    @GetMapping(value = "yw-service/leave/{id}")
    YwLeaveDO selectOne(@PathVariable("id") Long id);

    /**
     * 添加请假数据
     *
     * @param leaveDO 插入数据
     * @return 插入id
     */
    @PostMapping(value = "yw-service/leave")
    Long insert(@RequestBody YwLeaveDO leaveDO);

    /**
     * 修改请假数据
     *
     * @param leaveDO 请假数据
     * @return 差距结果
     */
    @PutMapping(value = "yw-service/leave")
    Integer update(@RequestBody YwLeaveDO leaveDO);

    /**
     * 删除数据
     *
     * @param id id
     * @return 结果
     */
    @DeleteMapping(value = "yw-service/leave/{id}")
    int delete(@PathVariable("id") Long id);


}
